//
//  MLAEateryFoodManageCell.m
//  MagicLampApp
//
//  Created by Zheng on 2019/4/12.
//  Copyright © 2019 zheng.magic.lamp.app. All rights reserved.
//

#import "MLAEateryFoodManageCell.h"

@implementation MLAEateryFoodManageCell

- (void)setModel:(MLAEateryFoodManageModel *)model {
    _model = model;
    
    [_foodImgv sd_setImageWithURL:[NSURL URLWithString:_model.product_imgs]];
    _nameLbl.text = _model.name;
    _priceLbl.text = [NSString stringWithFormat:@"¥ %@",_model.price];
    _typeLbl.text = _model.type_name;
    
}

- (void)awakeFromNib {
    [super awakeFromNib];

    [self.contentView sendSubviewToBack:self.shadowView];
    
    _foodImgv.layer.cornerRadius = 5;
    _foodImgv.layer.masksToBounds = YES;
    [_foodImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.shadowView).offset(15);
        make.top.equalTo(self.shadowView).offset(20);
        make.height.width.offset(50);
    }];
    
    [_nameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.foodImgv.mas_right).offset(10);
        make.top.equalTo(self.foodImgv).offset(5);
    }];
    
    [_priceLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLbl);
        make.bottom.equalTo(self.foodImgv).offset(-5);
    }];

    [_typeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLbl.mas_right).offset(10);
        make.centerY.equalTo(self.nameLbl);
    }];
    
    [_editImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.nameLbl);
        make.right.equalTo(self.shadowView).offset(-15);
        make.width.offset(26);
        make.height.offset(8);
    }];
    
    
}




@end
